article.help(ng-controller="ChangePasswordCtrl")
  .container-fluid
    .section.row-fluid.summary(ng-show="(static_is_authenticated && static_user) || password_change_required")
      .summary.col-sm-3(ng-show="!showCurrentPasswordField()")
        h3 Set Password
        p.lead
          | You have to set a password before you can connect.
      .summary.col-sm-3(ng-show="showCurrentPasswordField()")
        h3 Password change
        p.lead(ng-show="showCurrentPasswordField()")
          | Enter your current password and the new twice to change your password.
      .details.col-sm-9(ng-hide="password_changed")
        .form
          .row
            .col-sm-5(ng-show='showCurrentPasswordField()')
              | Current Password
              br
              input.form-control(type='password', focus-on="showCurrentPasswordField()", on-enter="focus", on-enter-target-id="new_connect_password1", ng-model="current_password", style="margin: 0", tabindex="1")
              br
          .row
            .col-sm-5
              | New Password
              br
              input.form-control(type='password', focus-on="!showCurrentPasswordField()", id="new_connect_password1", on-enter="focus", on-enter-target-id="new_connect_password2", ng-model="new_password", style="margin: 0", tabindex="2")
              br
          .row
            .col-sm-5
              | New Password Again
              br
              input.form-control(type='password', id="new_connect_password2", on-enter="click", on-enter-target-id="set_connect_password", ng-model="new_password2", style="margin: 0", tabindex="3")
              br
          .row
            .col-sm-5
              button.btn.btn-default(id="set_connect_password", ng-click="setNewPassword()", style="margin: 0") Set  password
      .details.col-sm-9(ng-show="password_changed")
        br
        br
        p Your new password is now in effect.
    .section.row-fluid.summary(ng-show="static_is_authenticated && !static_user && !password_change_required")
      .summary.col-sm-3
        h3 Password change
        p.lead This is not available.
      .details.col-sm-9
        p You can't change password when server auth is disabled.
    .section.row-fluid.summary(ng-show="!static_is_authenticated && !password_change_required")
      .summary.col-sm-3
        h3 Password change
        p.lead This is not available.
      .details.col-sm-9
        p You can't change password when not authenticated.
